package com.neuronrobotics.replicator.gui.preview.android;

import com.neuronrobotics.opengl.scene.GroupNode;
import com.neuronrobotics.opengl.scene.ArrayShapeNode;
import com.neuronrobotics.opengl.scene.TransformGroupNode;
import com.neuronrobotics.replicator.gui.stl.STLObject;

public class STLTransformGroupNode extends TransformGroupNode {
	
	private STLObject theSTLObject;
	private ArrayShapeNode theShape;
	private ArrayShapeNode theOutline;
	
	public STLTransformGroupNode(STLObject stl, ArrayShapeNode stlShape, ArrayShapeNode stlOutline){
		super();
		
		this.setTheSTLObject(stl);
		this.setTheShape(stlShape);
		this.setTheOutline(stlOutline);
		
		this.addChild(stlShape);
		this.addChild(stlOutline);
	}
	
	public STLTransformGroupNode(STLObject stl, ArrayShapeNode stlShape, ArrayShapeNode stlOutline, GroupNode parent){
		this(stl,stlShape,stlOutline);
		this.setParent(parent);
	}

	public STLObject getTheSTLObject() {
		return theSTLObject;
	}

	public void setTheSTLObject(STLObject theSTLObject) {
		this.theSTLObject = theSTLObject;
	}

	public ArrayShapeNode getTheShape() {
		return theShape;
	}

	public void setTheShape(ArrayShapeNode newShape) {
		if(this.theShape!=null){
			this.removeChild(theShape);
		}		
		this.theShape = newShape;
		if(this.theShape!=null){
			this.addChild(theShape);
		}
	}

	public ArrayShapeNode getTheOutline() {
		return theOutline;
	}

	public void setTheOutline(ArrayShapeNode newOutline) {
		if(this.theOutline!=null){
			this.removeChild(theOutline);
		}		
		this.theOutline = newOutline;
		if(this.theOutline!=null){
			this.addChild(theOutline);
		}
	}

}
